package org.wevil.repo;

import org.wevil.entity.view.ViewNews;
import org.wevil.vo.stat.BarVo;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface ViewNewsRepo extends BaseRepo<ViewNews, Integer>{
    @Query(value = "select new org.wevil.vo.stat.BarVo(subjectName, count(id)) from ViewNews group by subjectName")
    List<BarVo> countBySubject();

    @Query("select distinct username from ViewNews")
    List<String> findAllUsername();
}
